package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysYongyouXshtMapper;
import com.ruoyi.system.domain.SysYongyouXsht;
import com.ruoyi.system.service.ISysYongyouXshtService;

/**
 * 销售合同Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-18
 */
@Service
public class SysYongyouXshtServiceImpl implements ISysYongyouXshtService 
{
    @Autowired
    private SysYongyouXshtMapper sysYongyouXshtMapper;

    /**
     * 查询销售合同
     * 
     * @param orderdetailsFirstupcode 销售合同主键
     * @return 销售合同
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public SysYongyouXsht selectSysYongyouXshtByOrderdetailsFirstupcode(String orderdetailsFirstupcode)
    {
        return sysYongyouXshtMapper.selectSysYongyouXshtByOrderdetailsFirstupcode(orderdetailsFirstupcode);
    }

    /**
     * 查询销售合同列表
     * 
     * @param sysYongyouXsht 销售合同
     * @return 销售合同
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<SysYongyouXsht> selectSysYongyouXshtList(SysYongyouXsht sysYongyouXsht)
    {
        return sysYongyouXshtMapper.selectSysYongyouXshtList(sysYongyouXsht);
    }

    /**
     * 新增销售合同
     * 
     * @param sysYongyouXsht 销售合同
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertSysYongyouXsht(SysYongyouXsht sysYongyouXsht)
    {
        return sysYongyouXshtMapper.insertSysYongyouXsht(sysYongyouXsht);
    }

    /**
     * 修改销售合同
     * 
     * @param sysYongyouXsht 销售合同
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateSysYongyouXsht(SysYongyouXsht sysYongyouXsht)
    {
        return sysYongyouXshtMapper.updateSysYongyouXsht(sysYongyouXsht);
    }

    /**
     * 批量删除销售合同
     * 
     * @param orderdetailsFirstupcodes 需要删除的销售合同主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysYongyouXshtByOrderdetailsFirstupcodes(String[] orderdetailsFirstupcodes)
    {
        return sysYongyouXshtMapper.deleteSysYongyouXshtByOrderdetailsFirstupcodes(orderdetailsFirstupcodes);
    }

    /**
     * 删除销售合同信息
     * 
     * @param orderdetailsFirstupcode 销售合同主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysYongyouXshtByOrderdetailsFirstupcode(String orderdetailsFirstupcode)
    {
        return sysYongyouXshtMapper.deleteSysYongyouXshtByOrderdetailsFirstupcode(orderdetailsFirstupcode);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteByDateRange(String startDate,String endDate)
    {
        return sysYongyouXshtMapper.deleteByDateRange(startDate,endDate);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<SysYongyouXsht> selectSysYongyouXshtListByDateRange(String startDate,String endDate)
    {
        return sysYongyouXshtMapper.selectSysYongyouXshtListByDateRange(startDate,endDate);
    }
}
